/****************************************************
          File Name:10-3_imply.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Tue 23 Dec 2014 02:21:25 PM CST
*****************************************************/

#include"10-3.h"

/*
golf::golf(char name[], int icap)
{
    for(int i = 0; i < 40; i++)
        fullname[i] = '\0';
    for(int i=0; name[i]!='\0'; i++)
        fullname[i] = name[i];
    handicap = icap;
}
*/

golf::golf(const std::string & name, int icap)
{
    fullname = name;
    handicap = icap;
}

/*
void golf::setgolf(char name[], int icap)
{
    for(int i=0; i<40; i++)
    {
        fullname[i] = '\0';
    }
    for(int i=0; name[i]!='\0'; i++)
    {
        fullname[i] = name[i];
    }
    handicap = icap;
}
*/

void golf::setgolf(std::string & name, int icap)
{
    fullname = name;
    handicap = icap;
}
void golf::sethandicap(int n)
{
    handicap = n;
}

void golf::showgolf(const golf & g) const
{
    using std::cout;

    cout << "fullname: " << "\n";
    cout << g.fullname << "\n";
    cout << "handicap: " << "\n";
    cout << g.handicap << "\n";
}
